import request from '../config/request.js';
import host from '../config/host';

// 获取当前用户所属部门负责人
const getDefaultPeopleByDepartment = function(departmentID,callback) {
	request.getData(
	 host.hostUrl+'/department/getDepartmentLeader/'+departmentID,
	 callback
	)
}

// 根据部门获取用户
const getDepratmentUserList = function(departmentID,callback) {
	request.getData(
	 host.hostUrl+'/department/getDepratmentUserList/'+departmentID,
	 callback
	)
}

// 根据部门获取用户
const getAllUserByDepartmentId = function(departmentId,callback) {
	request.getData(
	 host.hostUrl+`/department/getAllUserByDepartmentId/${departmentId}`,
	 callback
	)
}

//转办用户查询
const listDepartmentUserFlat= function(data,callback){
	request.postData(
		host.hostUrl + '/user/queryUser',
		data,
		callback
	);
}
// 获取管辖区域用户
const getAdminister= function(departmentId,callback){
	request.getData(
		host.hostUrl + `/department/getAdminister/${departmentId}`,
		callback
	);
}

// 获取部门负责人
const getDepartmentLeaders = function(data,callback){
	request.postData(
		host.pcHostUrl + '/wx/department/getDepartmentLeaders',
		data,
		callback
	);
}


export default {
    getDefaultPeopleByDepartment,getDepratmentUserList,listDepartmentUserFlat,
	getAllUserByDepartmentId,
	getAdminister,
	getDepartmentLeaders,
}
